package com.zhijian.medical.config;

import com.zhijian.medical.util.SpringUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Spring容器工具类初始化
 *
 * @Author chengqing
 * @Version 1.0.1
 */
@Configuration
@ConditionalOnClass({ApplicationContext.class})
public class SpringIOCAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public SpringUtil springUtil(ApplicationContext context) {
        return new SpringUtil(context);
    }
}
